from sqlalchemy import create_engine
import tushare as ts

stockCode = '600004'
engine = create_engine('mysql+pymysql://tushare:tushare123@localhost/tushare?charset=utf8')

oneResult = ts.get_hist_data(stockCode,start='2017-08-03',end='2017-09-04')

path = '/home/tike/python_test/tushare/stock_num/'
oneResult.to_csv(path + stockCode + '.csv')
# engine = create_engine('mysql+pymysql://tushare:tushare123@localhost/tushare?charset=utf8')

# oneResult.to_sql('stock_hist_data', engine, if_exists='append')

